<template>
  <div>
    <a-card :bordered="false">
      <f-table ref="table" rowKey="backcardRecordId" :columns="columns" :multiple="true" :operator="operator"
               :params="queryParam" :api="api.backcardRecord">
        <span slot="action" slot-scope="text, record">
          <template>
            <a @click="$refs.drawer.showDrawer(record)">编辑</a>
            <a-divider type="vertical"/>
          </template>
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
            <a-menu slot="overlay">
              <a-menu-item v-if="$auth('table.delete')">
                <a href="javascript:;" @click="$refs.table.del(record)">删除</a>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
      </f-table>
      <bbr-drawer ref="drawer"></bbr-drawer>
    </a-card>
  </div>
</template>
<script>
  import bbrDrawer from './bbr_drawer.vue'
  import api from './js/api'

  export default {
    name: 'TableList',
    components: {
      bbrDrawer
    },
    data() {
      let me = this
      //操作按钮
      let operator = []
      operator.push({
        name: '添加',
        icon: 'plus',
        that: this,
        handler: function(table, that) {
          that.$refs.drawer.showDrawer()
        }
      })
      operator.push({
        name: '删除',
        icon: 'delete',
        batch: true,
        handler: function(table) {
          table.remove()
        }
      })
      return {
        api: Object.assign(api, this.api),
        //列表初始化查询参数
        queryParam: {},
        // 表头
        columns: [
          {
            title: '#',
            width: '60',
            align: 'center',
            customRender: (text, record, index) => index + 1
          },
          {
            title: '用户id',
            align: 'center',
            dataIndex: 'userId'
          },
          {
            title: '1已提交,2取消提交,3退卡专员审核中,4退卡专员审核拒绝,5退卡专员审核通过,6退款专员专员审核中,7退款专员审核拒绝,8退款专员审核通过,9财务经理审核中,10财务经理审核拒绝,11财务经理审核通过',
            align: 'center',
            dataIndex: 'isCheck'
          },
          {
            title: '提交者',
            align: 'center',
            dataIndex: 'submitUserId'
          },
          {
            title: '退卡卡号',
            align: 'center',
            dataIndex: 'vipCardNo'
          },
          {
            title: '开户行',
            align: 'center',
            dataIndex: 'bank'
          },
          {
            title: '银行卡号',
            align: 'center',
            dataIndex: 'bankNo'
          },
          {
            title: 'refund_ali,refund_wx,refund_bank',
            align: 'center',
            dataIndex: 'refundWay'
          },
          {
            title: '承担（1会员全部承担，会员部分承担）',
            align: 'center',
            dataIndex: 'bearWay'
          },
          {
            title: '会员承担金额',
            align: 'center',
            dataIndex: 'vipBearAmount'
          },
          {
            title: '销售承担金额',
            align: 'center',
            dataIndex: 'saleBearAmount'
          },
          {
            title: '退卡金额',
            align: 'center',
            dataIndex: 'refundAmount'
          },
          {
            title: '退卡备注说明',
            align: 'center',
            dataIndex: 'remark'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'accountGoodsId'
          },
          {
            title: '地区',
            align: 'center',
            dataIndex: 'airportId'
          },
          {
            title: '退卡专员备注',
            align: 'center',
            dataIndex: 'remarka'
          },
          {
            title: '退款专员备注',
            align: 'center',
            dataIndex: 'remarkb'
          },
          {
            title: '',
            align: 'center',
            dataIndex: 'refundDate'
          },
          {
            title: '退款凭证',
            align: 'center',
            dataIndex: 'refundImg'
          },
          {
            title: '退卡原因',
            align: 'center',
            dataIndex: 'refundReason'
          },
          {
            title: '补退方式',
            align: 'center',
            dataIndex: 'addRefundWay'
          },
          {
            title: '补退备注',
            align: 'center',
            dataIndex: 'addRefundRemark'
          },
          {
            title: '补退金额',
            align: 'center',
            dataIndex: 'addRefundAmount'
          },
          {
            title: '标记备注',
            align: 'center',
            dataIndex: 'tagRemark'
          },
          {
            title: '退卡退款状态',
            align: 'center',
            dataIndex: 'returnState'
          },
          {
            title: '是否删除',
            align: 'center',
            dataIndex: 'deleted'
          },
          {
            title: '更新人',
            align: 'center',
            dataIndex: 'updateUser'
          },
          {
            title: '更新时间',
            align: 'center',
            dataIndex: 'updateTime'
          },
          {
            title: '创建人',
            align: 'center',
            dataIndex: 'createUser'
          },
          {
            title: '创建时间',
            align: 'center',
            dataIndex: 'createTime'
          },
          {
            title: '操作',
            align: 'center',
            scopedSlots: { customRender: 'action' }
          }
        ],
        operator: operator
      }
    },
    created() {
    },
    methods: {}
  }
</script>
